
<?php 
$report_row = isset($report[0][0]) ? $report[0][0] : false;

if( !$report_row ) {
    echo "<div class='alert alert-info'>No Results Returned For The Report Run With Above Parameters</div>";
    return;
}
?>

<style>
    #report_result_table td, #report_result_table th {
        font-size: 11px;
    }
</style>

<table id="report_result_table" class="table table-striped table-condensed table-bordered">
    <thead>
        <?php
        
        $columns = array(" ");
        
        foreach($report_row as $table_name => $row) {
            $columns = array_merge($columns, array_keys($row));
        }
        
        foreach($columns as $key => $value) {
            echo "<th>$value</th>";
        }
        ?>
    </thead>
    
    <tbody>
        <?php 
        $count = 1;
        foreach($report[0] as $report_row) {
            echo "<tr>";
            echo "<td style='text-align: right;'>$count.</td>";
            
            foreach($report_row as $table_name => $row) {    
                foreach($row as $column_name => $value) {
                    echo "<td>$value</td>";
                }
            }
            
            echo "</tr>";
            
            $count++;
        }
        ?>
    </tbody>
</table>